@import "themes";

.form-control::-moz-placeholder {
  @include placeholder($medium-dark-gray, 1);
}

.form-control:-moz-placeholder {
  @include placeholder($medium-dark-gray, 1);
}

.form-control::-webkit-input-placeholder {
  @include placeholder($medium-dark-gray, 1);
}

.form-control:-ms-input-placeholder {
  @include placeholder($medium-dark-gray, 1);
}

.form-control {
  border-radius: $border-radius-base;
  font-size: $font-size-base*1.2;
  transition: background-color 0.3s ease 0s;
  @include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
  @include box-shadow(none);
  @include themed() {
    background-color: t('inputBackgroundColor');
    border-color: t('inputBorderColor');
    color: t('inputTextColor');
  }

  &:focus {
    @include box-shadow(none);
    outline: 0 !important;
    @include themed() {
      background-color: t('inputBackgroundColor');
    }
  }

  .has-success &,
  .has-error &,
  .has-success &:focus,
  .has-error &:focus {
    @include box-shadow(none);
  }

  .has-success & {
    background-color: $success-input-bg;
    color: $success-color;
    &.border-input {
      border: 0.0625em solid $success-color;
    }
  }
  .has-success &:focus {
    background-color: $white-bg;
  }
  .has-error & {
    background-color: $danger-input-bg;
    color: $danger-color;
    &.border-input {
      border: 0.0625em solid $danger-color;
    }
  }
  .has-error &:focus {
    background-color: $white-bg;
  }

  & + .form-control-feedback {
    border-radius: $border-radius-large;
    font-size: $font-size-base;
    margin-top: -0.4375em;
    position: absolute;
    right: 0.625em;
    top: 50%;
    vertical-align: middle;
  }
  &.border-input {
    border: 0.0625em solid;
    @include themed() {
      border-color: t('inputBorderColor');
    }
  }
  .open & {
    border-bottom-color: transparent;
  }
}

.input-lg {
  height: 3.4375em;
  padding: $padding-large-vertical $padding-large-horizontal;
}

.has-error {
  .form-control-feedback, .control-label {
    color: $danger-color;
  }
}

.has-success {
  .form-control-feedback, .control-label {
    color: $success-color;
  }
}

.input-group-addon {
  background-color: $gray-input-bg;
  border-radius: $border-radius-base;

  .has-success &,
  .has-error & {
    background-color: $white-color;
  }
  .has-error .form-control:focus + & {
    color: $danger-color;
  }
  .has-success .form-control:focus + & {
    color: $success-color;
  }
  .form-control:focus + &,
  .form-control:focus ~ & {
    background-color: $white-color;
  }
}

.border-input {
  .input-group-addon {
    border: solid 0.0625em;
    @include themed() {
      border-color: t('inputBorderColor');
    }
  }
}

.input-group {
  margin-bottom: 0.9375em;
}

.input-group[disabled] {
  .input-group-addon {
    @include themed() {
      background-color: t('inputDisabledBackgroundColor');
      color: t('inputDisabledTextColor');
    }
  }
}

.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
  border-right: 0 none;
}

.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
  border-left: 0 none;
}

.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
  @include themed() {
    background-color: t('inputDisabledBackgroundColor');
    color: t('inputDisabledTextColor');
  }
  cursor: not-allowed;
}

.form-control[disabled]::-moz-placeholder {
  @include themed() {
    color: t('inputPlaceholderColor');
  }
}

.form-control[disabled]:-moz-placeholder {
  @include themed() {
    color: t('inputPlaceholderColor');
  }
}

.form-control[disabled]::-webkit-input-placeholder {
  @include themed() {
    color: t('inputPlaceholderColor');
  }
}

.form-control[disabled]:-ms-input-placeholder {
  @include themed() {
    color: t('inputPlaceholderColor');
  }
}

.input-group-btn .btn {
  font-size: $font-size-base*1;
  border-width: $border-thin;
  padding: $padding-round-vertical $padding-base-horizontal;
}

.input-group-btn .btn-default:not(.btn-fill) {
  @include themed() {
    border-color: t('inputBorderColor');
  }
}

.input-group-btn:last-child > .btn {
  margin-left: 0;
}

textarea.form-control {
  max-width: 100%;
  padding: 0.625em 1.125em;
  resize: none;
}

